import {
  axios
} from '@/utils/request'

// 获取软件包制作列表
function getSoftwareMakeList (params) {
  return axios({
    url: '/software-service/softwareMake/list',
    method: 'get',
    params
  })
}

// 获取软件包ECU列表
function getSoftwareMakeEcuList (params) {
  return axios({
    url: '/software-service/softwareMake/selectEcu',
    method: 'get',
    params
  })
}

// 软件包加密
function softwareMakeEncrypt (data) {
  return axios({
    url: '/software-service/softwareMake/encrypt',
    method: 'post',
    data
  })
}

// 软件包在线差分
function softwareMakeDiff (data) {
  return axios({
    url: '/software-service/softwareMake/diff',
    method: 'post',
    data
  })
}

// 软件包下载
function softwareDownload (id) {
  return axios({
    url: '/file-service/file/download/resource/'+id,
    method: 'post',
    responseType: 'blob',
    timeout:60 * 60 * 1000
  })
}

// 软件包制作列表重试
function softwareRetry (data) {
  return axios({
    url: '/software-service/softwareMake/retry',
    method: 'post',
    data
  })
}

// 软件包制作列表废弃
function softwareDisabled (data) {
  return axios({
    url: '/software-service/softwareMake/disabled',
    method: 'post',
    data
  })
}

export default {
  getSoftwareMakeList,
  getSoftwareMakeEcuList,
  softwareMakeEncrypt,
  softwareMakeDiff,
  softwareDownload,
  softwareRetry,
  softwareDisabled
}